<template>
    <div>
        <div class="breadcrumb-box">
            <el-breadcrumb separator-class="el-icon-arrow-right">
                <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
                <el-breadcrumb-item>需求上架</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="line">
            <img :src="$global.Image.icon_goods_line" />
        </div>
        <div class="container">
            <div class="line-ti">
                <div>需求上架</div>
                <router-link class="new" :to="`/demandCreate`">新增需求上架</router-link>
            </div>
            <div class="list">
                <router-link :to="'/demandDetail/' + item.id" class="itm" v-for="(item,index) in list" :key="index">
                    <div class="title">{{item.name}}</div>
                    <div class="brand">品牌：{{item.brand}}</div>
                    <div class="itm-b">
                        <div class="itm-name">{{item.contacts}} {{item.mobile}}</div>
                        <div class="itm-line"></div>
                        <div class="itm-date">{{item.create_time}}</div>
                    </div>
                </router-link>
                <div class="itm-1"></div>
            </div>
            <div class="nodata" v-if="list.length == 0">
                <img :src="$global.Image.noData" />
            </div>
            <el-pagination background layout="prev, pager, next" :total="page" :size="limit">
            </el-pagination>
        </div>
    </div>
</template>

<script>
import {artIcleList} from '@api/user';
export default {
    data() {
        return {
            loading: false,
            type: 1,
            page: 1,
            limit: 18,
            count: 0,
            list: [],
        }
    },
    methods:{
        getList(){
            let data = {
                type: this.type,
                page_index:this.page,
                page_size:this.limit
            }
            if (this.loading) return;
            this.loading = true
            artIcleList(data).then(res => {
                this.list = res.data.list;
                this.count = res.data.count || 0;
                this.loading = false
            });
        }
    },
    mounted(){
        this.getList()
    }
};
</script>
<style lang="scss" scoped>
@import '../../assets/css/common/list.scss';
</style>